const Koa = require("koa");
const Router = require("koa-router");
const views = require("koa-views");
// https://www.npmjs.com/
const static = require("koa-static");
let app = new Koa();
let router = new Router();
// console.log(__dirname);
// console.log(__filename);

app.use(views(__dirname+"/views"));
app.use(static(__dirname+"/static"));
router.get("/index",async ctx=>{
   await ctx.render("index.html");
});

router.get("/product",async ctx=>{
    await ctx.render("product.html");
});

app.use(router.routes());
app.listen(8989);